Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switch to dnd-kit for drag and drop #2239

Closed
wants to merge 21 commits into from
Closed

Switch to dnd-kit for drag and drop #2239

wants to merge 21 commits into from

Conversation

joel-jeremy
Copy link
Contributor

@joel-jeremy joel-jeremy commented Jan 16, 2024

Main goal of the switch is to have a usable drag-and-drop functionality in mobile.

@trafico-bot trafico-bot bot added the 🚧 WIP label Jan 16, 2024
Copy link

netlify bot commented Jan 16, 2024

Deploy Preview for actualbudget ready!

Name Link
🔨 Latest commit 1877286
🔍 Latest deploy log https://app.netlify.com/sites/actualbudget/deploys/65b17abfdfa16400081bf20d
😎 Deploy Preview https://deploy-preview-2239.demo.actualbudget.org/
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link
Contributor

github-actions bot commented Jan 16, 2024

Bundle Stats — desktop-client

Hey there, this message comes from a GitHub action that helps you and reviewers to understand how these changes affect the size of this project's bundle.

As this PR is updated, I'll keep you updated on how the bundle size is impacted.

Total

Files count Total bundle size % Changed
10 4.47 MB → 4.98 MB (+529.57 kB) +11.58%
Changeset (largest 100 files by percent change)
File Δ Size
node_modules/reduce-css-calc/dist/parser.js 🆕 +121.4 kB 0 B → 121.4 kB
node_modules/@dnd-kit/core/dist/core.esm.js 🆕 +89.32 kB 0 B → 89.32 kB
node_modules/victory-core/es/victory-util/textsize.js 🆕 +38.08 kB 0 B → 38.08 kB
node_modules/victory-tooltip/es/victory-tooltip.js 🆕 +24.53 kB 0 B → 24.53 kB
node_modules/@react-spring/core/dist/esm/index.js 🆕 +23.17 kB 0 B → 23.17 kB
node_modules/victory-core/es/victory-label/victory-label.js 🆕 +22.69 kB 0 B → 22.69 kB
node_modules/victory-axis/es/helper-methods.js 🆕 +21.87 kB 0 B → 21.87 kB
node_modules/react-virtualized-auto-sizer/dist/react-virtualized-auto-sizer.module.js 🆕 +18.9 kB 0 B → 18.9 kB
node_modules/victory-bar/es/path-helper-methods.js 🆕 +18.1 kB 0 B → 18.1 kB
node_modules/victory-core/es/victory-util/add-events.js 🆕 +17.92 kB 0 B → 17.92 kB
node_modules/victory-core/es/victory-util/events.js 🆕 +17.35 kB 0 B → 17.35 kB
node_modules/@dnd-kit/sortable/dist/sortable.esm.js 🆕 +16.52 kB 0 B → 16.52 kB
node_modules/victory-shared-events/es/victory-shared-events.js 🆕 +16.28 kB 0 B → 16.28 kB
node_modules/victory-core/es/victory-util/wrapper.js 🆕 +15.65 kB 0 B → 15.65 kB
node_modules/victory-core/es/victory-util/domain.js 🆕 +15.49 kB 0 B → 15.49 kB
node_modules/victory-axis/es/victory-axis.js 🆕 +14.41 kB 0 B → 14.41 kB
node_modules/victory-core/es/victory-util/transitions.js 🆕 +14.17 kB 0 B → 14.17 kB
node_modules/victory-polar-axis/es/helper-methods.js 🆕 +14 kB 0 B → 14 kB
node_modules/victory-core/es/victory-util/axis.js 🆕 +13.63 kB 0 B → 13.63 kB
node_modules/victory-core/es/victory-util/data.js 🆕 +13.52 kB 0 B → 13.52 kB
node_modules/victory-polar-axis/es/victory-polar-axis.js 🆕 +12.95 kB 0 B → 12.95 kB
node_modules/@react-spring/shared/dist/esm/index.js 🆕 +12.82 kB 0 B → 12.82 kB
node_modules/victory-core/es/victory-container/victory-container.js 🆕 +11.85 kB 0 B → 11.85 kB
node_modules/victory-stack/es/helper-methods.js 🆕 +10.8 kB 0 B → 10.8 kB
node_modules/victory-core/es/victory-util/helpers.js 🆕 +10.78 kB 0 B → 10.78 kB
node_modules/victory-core/es/victory-transition/victory-transition.js 🆕 +10.22 kB 0 B → 10.22 kB
node_modules/victory-core/es/victory-animation/victory-animation.js 🆕 +10.14 kB 0 B → 10.14 kB
src/components/filters/SavedFilters.jsx 🆕 +9.54 kB 0 B → 9.54 kB
node_modules/react-resize-detector/build/index.esm.js 🆕 +9.43 kB 0 B → 9.43 kB
node_modules/d3-shape/src/arc.js 🆕 +8.52 kB 0 B → 8.52 kB
node_modules/reduce-css-calc/dist/lib/reducer.js 🆕 +8.13 kB 0 B → 8.13 kB
node_modules/victory-chart/es/helper-methods.js 🆕 +7.98 kB 0 B → 7.98 kB
node_modules/@dnd-kit/utilities/dist/utilities.esm.js 🆕 +7.49 kB 0 B → 7.49 kB
node_modules/victory-bar/es/victory-bar.js 🆕 +7.48 kB 0 B → 7.48 kB
node_modules/victory-core/es/victory-animation/util.js 🆕 +7.06 kB 0 B → 7.06 kB
node_modules/victory-core/es/victory-util/hooks/use-animation-state.js 🆕 +6.57 kB 0 B → 6.57 kB
node_modules/victory-chart/es/victory-chart.js 🆕 +6.41 kB 0 B → 6.41 kB
node_modules/victory-tooltip/es/flyout.js 🆕 +6.24 kB 0 B → 6.24 kB
node_modules/victory-core/es/victory-util/prop-types.js 🆕 +6.22 kB 0 B → 6.22 kB
node_modules/victory-stack/es/victory-stack.js 🆕 +6.18 kB 0 B → 6.18 kB
node_modules/victory-core/es/victory-util/label-helpers.js 🆕 +6.17 kB 0 B → 6.17 kB
node_modules/postcss-value-parser/lib/parse.js 🆕 +6.02 kB 0 B → 6.02 kB
node_modules/victory-core/es/victory-util/user-props.js 🆕 +5.82 kB 0 B → 5.82 kB
node_modules/victory-core/es/victory-theme/material.js 🆕 +5.66 kB 0 B → 5.66 kB
node_modules/victory-core/es/victory-util/common-props.js 🆕 +5.62 kB 0 B → 5.62 kB
node_modules/victory-core/es/victory-portal/victory-portal.js 🆕 +5.4 kB 0 B → 5.4 kB
node_modules/victory-core/es/victory-theme/grayscale.js 🆕 +4.93 kB 0 B → 4.93 kB
node_modules/react-fast-compare/index.js 🆕 +4.79 kB 0 B → 4.79 kB
src/components/reports/reports/CategorySpending.jsx 🆕 +4.44 kB 0 B → 4.44 kB
node_modules/victory-core/es/victory-portal/portal.js 🆕 +4.17 kB 0 B → 4.17 kB
src/components/reports/spreadsheets/category-spending-spreadsheet.tsx 🆕 +4.1 kB 0 B → 4.1 kB
src/components/sidebar/SidebarWithData.tsx 🆕 +4.1 kB 0 B → 4.1 kB
node_modules/@react-spring/web/dist/esm/index.js 🆕 +4.03 kB 0 B → 4.03 kB
node_modules/victory-bar/es/bar.js 🆕 +4.02 kB 0 B → 4.02 kB
node_modules/victory-bar/es/helper-methods.js 🆕 +3.94 kB 0 B → 3.94 kB
node_modules/victory-core/es/victory-primitives/arc.js 🆕 +3.83 kB 0 B → 3.83 kB
node_modules/@react-spring/animated/dist/esm/index.js 🆕 +3.67 kB 0 B → 3.67 kB
node_modules/victory-core/es/victory-util/scale.js 🆕 +3.63 kB 0 B → 3.63 kB
node_modules/victory-bar/es/geometry-helper-methods.js 🆕 +3.22 kB 0 B → 3.22 kB
node_modules/d3-timer/src/timer.js 🆕 +2.82 kB 0 B → 2.82 kB
node_modules/victory-core/es/victory-util/collection.js 🆕 +2.78 kB 0 B → 2.78 kB
node_modules/css-unit-converter/index.js 🆕 +2.57 kB 0 B → 2.57 kB
node_modules/victory-core/es/victory-primitives/line-segment.js 🆕 +2.53 kB 0 B → 2.53 kB
home/runner/work/actual/actual/packages/loot-core/src/shared/categories.ts 🆕 +2.49 kB 0 B → 2.49 kB
node_modules/victory-core/es/victory-primitives/background.js 🆕 +2.48 kB 0 B → 2.48 kB
node_modules/victory-core/es/victory-util/timer.js 🆕 +2.44 kB 0 B → 2.44 kB
src/components/reports/graphs/common.tsx 🆕 +2.23 kB 0 B → 2.23 kB
node_modules/victory-core/es/victory-util/style.js 🆕 +2.18 kB 0 B → 2.18 kB
node_modules/reduce-css-calc/dist/lib/stringifier.js 🆕 +2.16 kB 0 B → 2.16 kB
node_modules/victory-bar/es/bar-helper-methods.js 🆕 +2.07 kB 0 B → 2.07 kB
node_modules/lodash/isEmpty.js 🆕 +1.95 kB 0 B → 1.95 kB
src/components/reports/Tooltip.jsx 🆕 +1.91 kB 0 B → 1.91 kB
src/components/reports/graphs/CategorySpendingGraph.tsx 🆕 +1.85 kB 0 B → 1.85 kB
node_modules/lodash/_baseDifference.js 🆕 +1.81 kB 0 B → 1.81 kB
node_modules/@react-spring/rafz/dist/esm/index.js 🆕 +1.79 kB 0 B → 1.79 kB
node_modules/lodash/defaults.js 🆕 +1.75 kB 0 B → 1.75 kB
node_modules/lodash/includes.js 🆕 +1.75 kB 0 B → 1.75 kB
node_modules/victory-core/es/victory-primitives/circle.js 🆕 +1.71 kB 0 B → 1.71 kB
node_modules/victory-core/es/victory-primitives/rect.js 🆕 +1.71 kB 0 B → 1.71 kB
node_modules/victory-core/es/victory-primitives/line.js 🆕 +1.69 kB 0 B → 1.69 kB
node_modules/reduce-css-calc/dist/index.js 🆕 +1.68 kB 0 B → 1.68 kB
src/components/reports/reports/CategorySpendingCard.jsx 🆕 +1.63 kB 0 B → 1.63 kB
node_modules/lodash/orderBy.js 🆕 +1.63 kB 0 B → 1.63 kB
node_modules/lodash/assign.js 🆕 +1.54 kB 0 B → 1.54 kB
src/components/autocomplete/SavedFilterAutocomplete.tsx 🆕 +1.42 kB 0 B → 1.42 kB
node_modules/lodash/groupBy.js 🆕 +1.4 kB 0 B → 1.4 kB
node_modules/victory-core/es/victory-primitives/text.js 🆕 +1.37 kB 0 B → 1.37 kB
node_modules/lodash/_baseSet.js 🆕 +1.3 kB 0 B → 1.3 kB
node_modules/classnames/index.js 🆕 +1.27 kB 0 B → 1.27 kB
node_modules/victory-core/es/victory-primitives/path.js 🆕 +1.26 kB 0 B → 1.26 kB
src/components/util/sort.ts 🆕 +1.22 kB 0 B → 1.22 kB
node_modules/d3-ease/src/elastic.js 🆕 +1.21 kB 0 B → 1.21 kB
node_modules/postcss-value-parser/lib/stringify.js 🆕 +1.16 kB 0 B → 1.16 kB
node_modules/lodash/invert.js 🆕 +1.13 kB 0 B → 1.13 kB
node_modules/json-stringify-safe/stringify.js 🆕 +1.1 kB 0 B → 1.1 kB
node_modules/postcss-value-parser/lib/unit.js 🆕 +1.1 kB 0 B → 1.1 kB
node_modules/reduce-css-calc/dist/lib/convert.js 🆕 +1.06 kB 0 B → 1.06 kB
node_modules/lodash/difference.js 🆕 +1.06 kB 0 B → 1.06 kB
node_modules/lodash/negate.js 🆕 +1.06 kB 0 B → 1.06 kB
node_modules/@dnd-kit/accessibility/dist/accessibility.esm.js 🆕 +1.03 kB 0 B → 1.03 kB
View detailed bundle breakdown

Added

Asset File Size % Changed
static/js/FiltersMenu.js 0 B → 28.92 kB (+28.92 kB) -

Removed

Asset File Size % Changed
static/js/AppliedFilters.js 20.35 kB → 0 B (-20.35 kB) -100%

Bigger

Asset File Size % Changed
static/js/ReportRouter.js 1.21 MB → 1.84 MB (+649.7 kB) +52.58%
static/js/narrow.js 79.85 kB → 84.28 kB (+4.42 kB) +5.54%

Smaller

Asset File Size % Changed
static/js/index.js 2.74 MB → 2.64 MB (-107.15 kB) -3.81%
static/js/wide.js 267.47 kB → 241.49 kB (-25.98 kB) -9.71%

Unchanged

Asset File Size % Changed
static/js/indexeddb-main-thread-worker-e59fee74.js 13.5 kB 0%
static/js/resize-observer.js 18.37 kB 0%
static/js/ButtonLink.js 379 B 0%
static/js/BackgroundImage.js 122.29 kB 0%
static/js/BalanceTooltip.js 6.06 kB 0%

Copy link
Contributor

github-actions bot commented Jan 16, 2024

Bundle Stats — loot-core

Hey there, this message comes from a GitHub action that helps you and reviewers to understand how these changes affect the size of this project's bundle.

As this PR is updated, I'll keep you updated on how the bundle size is impacted.

Total

Files count Total bundle size % Changed
1 1.2 MB → 1.18 MB (-17.09 kB) -1.39%
Changeset
File Δ Size
node_modules/es6-object-assign/index.js 🆕 +1.14 kB 0 B → 1.14 kB
node_modules/is-typed-array/index.js 📈 +1.58 kB (+1056.86%) 153 B → 1.73 kB
node_modules/regexp.prototype.flags/implementation.js 📈 +152 B (+21.90%) 694 B → 846 B
node_modules/call-bind/index.js 📈 +94 B (+7.76%) 1.18 kB → 1.28 kB
node_modules/memfs/lib/process.js 📈 +82 B (+6.76%) 1.18 kB → 1.26 kB
node_modules/uuid/dist/esm-browser/stringify.js 📈 +16 B (+1.09%) 1.43 kB → 1.45 kB
packages/loot-core/src/server/main.ts 📈 +324 B (+0.48%) 65.67 kB → 65.98 kB
node_modules/fs-monkey/lib/correctPath.js 📈 +3 B (+0.27%) 1.08 kB → 1.08 kB
packages/loot-core/src/mocks/budget.ts 📈 +35 B (+0.12%) 28.48 kB → 28.52 kB
node_modules/get-intrinsic/index.js 📉 -3 B (-0.02%) 13.01 kB → 13.01 kB
packages/loot-core/src/shared/util.ts 📉 -4 B (-0.04%) 9.12 kB → 9.12 kB
packages/loot-core/src/shared/transactions.ts 📉 -7 B (-0.08%) 8.1 kB → 8.1 kB
packages/loot-core/src/shared/schedules.ts 📉 -23 B (-0.25%) 9.06 kB → 9.04 kB
packages/loot-core/src/server/accounts/sync.ts 📉 -155 B (-0.47%) 32.19 kB → 32.04 kB
packages/loot-core/src/server/accounts/transaction-rules.ts 📉 -148 B (-0.53%) 27.29 kB → 27.15 kB
node_modules/memfs/lib/Stats.js 📉 -24 B (-0.83%) 2.83 kB → 2.8 kB
packages/loot-core/src/server/aql/schema/index.ts 📉 -169 B (-1.19%) 13.9 kB → 13.73 kB
node_modules/memfs/lib/Dirent.js 📉 -30 B (-1.60%) 1.83 kB → 1.8 kB
node_modules/deep-equal/index.js 📉 -223 B (-1.67%) 13.02 kB → 12.8 kB
node_modules/which-typed-array/index.js 📉 -43 B (-1.79%) 2.35 kB → 2.31 kB
packages/loot-core/src/server/db/index.ts 📉 -372 B (-2.05%) 17.71 kB → 17.34 kB
node_modules/memfs/lib/constants.js 📉 -28 B (-2.67%) 1.02 kB → 1020 B
packages/loot-core/src/server/rules/app.ts 📉 -107 B (-3.03%) 3.44 kB → 3.34 kB
node_modules/assert/build/internal/util/comparisons.js 📉 -701 B (-3.27%) 20.91 kB → 20.23 kB
node_modules/memfs/lib/promises.js 📉 -220 B (-3.42%) 6.27 kB → 6.06 kB
node_modules/memfs/lib/index.js 📉 -81 B (-3.75%) 2.11 kB → 2.03 kB
node_modules/memfs/lib/internal/errors.js 📉 -608 B (-4.81%) 12.35 kB → 11.75 kB
node_modules/assert/build/internal/assert/assertion_error.js 📉 -1.29 kB (-5.69%) 22.68 kB → 21.39 kB
packages/loot-core/src/server/accounts/ofx2json.ts 📉 -411 B (-8.88%) 4.52 kB → 4.12 kB
node_modules/fs-monkey/lib/util/lists.js 📉 -127 B (-9.38%) 1.32 kB → 1.2 kB
node_modules/memfs/lib/encoding.js 📉 -81 B (-9.75%) 831 B → 750 B
node_modules/memfs/lib/volume.js 📉 -9.28 kB (-10.29%) 90.23 kB → 80.95 kB
node_modules/memfs/lib/setTimeoutUnref.js 📉 -51 B (-10.34%) 493 B → 442 B
packages/loot-core/src/shared/rules.ts 📉 -936 B (-11.53%) 7.92 kB → 7.01 kB
node_modules/assert/build/assert.js 📉 -2.52 kB (-11.68%) 21.56 kB → 19.04 kB
node_modules/memfs/lib/internal/buffer.js 📉 -209 B (-18.08%) 1.13 kB → 947 B
packages/loot-core/src/server/accounts/rules.ts 📉 -5.74 kB (-19.90%) 28.84 kB → 23.1 kB
node_modules/assert/build/internal/errors.js 📉 -1.98 kB (-21.74%) 9.12 kB → 7.14 kB
node_modules/memfs/lib/node.js 📉 -3.81 kB (-22.81%) 16.72 kB → 12.9 kB
node_modules/memfs/lib/setImmediate.js 📉 -98 B (-26.92%) 364 B → 266 B
node_modules/function-bind/implementation.js 📉 -580 B (-28.39%) 2 kB → 1.43 kB
packages/loot-core/src/server/budget/cleanup-template.ts 📉 -2.85 kB (-33.90%) 8.42 kB → 5.57 kB
packages/loot-core/src/server/reports/app.ts 📉 -1.91 kB (-44.77%) 4.27 kB → 2.36 kB
node_modules/define-data-property/index.js 🔥 -2.77 kB (-100%) 2.77 kB → 0 B
node_modules/set-function-length/index.js 🔥 -1.36 kB (-100%) 1.36 kB → 0 B
node_modules/set-function-name/index.js 🔥 -623 B (-100%) 623 B → 0 B
node_modules/hasown/index.js 🔥 -234 B (-100%) 234 B → 0 B
View detailed bundle breakdown

Added

No assets were added

Removed

No assets were removed

Bigger

No assets were bigger

Smaller

Asset File Size % Changed
kcab.worker.js 1.2 MB → 1.18 MB (-17.09 kB) -1.39%

Unchanged

No assets were unchanged

@youngcw
Copy link
Member

youngcw commented Jan 17, 2024

ooh, thats nice. Are you hoping to use this to rearrange transactions too?

@joel-jeremy
Copy link
Contributor Author

Yeah, also hoping this fixes drag and drop in mobile as well.

@joel-jeremy joel-jeremy changed the title [WIP] Use dnd-kit for drag and drop Switch to dnd-kit for drag and drop Jan 19, 2024
@Teprifer
Copy link

Teprifer commented Jan 19, 2024

Firefox 121.0.1 (64-bit) (on desktop)
Imported my budget from latest live.

Easily reproduced error doing dragging and drop of categories although I'm not sure on the exact steps as there seems to be some volatility.
I was grabbing a category, waving it around a bit, and then would grab another and it'd frequently crash then. Sometimes after reloading the page after a crash it'd crash as soon as I grabbed a category.

Show error from actual:

A@https://deploy-preview-2239.demo.actualbudget.org/static/js/wide.XKheaPwd.chunk.js:1:20791 Hye</</<@https://deploy-preview-2239.demo.actualbudget.org/static/js/index.-47GFWev.js:202:30058 U1@https://deploy-preview-2239.demo.actualbudget.org/static/js/index.-47GFWev.js:51:36944 Hye</<@https://deploy-preview-2239.demo.actualbudget.org/static/js/index.-47GFWev.js:202:30025 Cg@https://deploy-preview-2239.demo.actualbudget.org/static/js/index.-47GFWev.js:51:24270 yl@https://deploy-preview-2239.demo.actualbudget.org/static/js/index.-47GFWev.js:51:42398 Kk@https://deploy-preview-2239.demo.actualbudget.org/static/js/index.-47GFWev.js:51:36612 Ta@https://deploy-preview-2239.demo.actualbudget.org/static/js/index.-47GFWev.js:49:3279 gB@https://deploy-preview-2239.demo.actualbudget.org/static/js/index.-47GFWev.js:51:41273 La@https://deploy-preview-2239.demo.actualbudget.org/static/js/index.-47GFWev.js:51:40265 SD@https://deploy-preview-2239.demo.actualbudget.org/static/js/index.-47GFWev.js:51:35722 I@https://deploy-preview-2239.demo.actualbudget.org/static/js/index.-47GFWev.js:36:1545 R@https://deploy-preview-2239.demo.actualbudget.org/static/js/index.-47GFWev.js:36:1903

Browser console:
image

Same idea but crashing as soon as I moved a category after reloading:

A@https://deploy-preview-2239.demo.actualbudget.org/static/js/wide.XKheaPwd.chunk.js:1:20791 Hye</</<@https://deploy-preview-2239.demo.actualbudget.org/static/js/index.-47GFWev.js:202:30058 U1@https://deploy-preview-2239.demo.actualbudget.org/static/js/index.-47GFWev.js:51:36944 Hye</<@https://deploy-preview-2239.demo.actualbudget.org/static/js/index.-47GFWev.js:202:30025 Cg@https://deploy-preview-2239.demo.actualbudget.org/static/js/index.-47GFWev.js:51:24270 yl@https://deploy-preview-2239.demo.actualbudget.org/static/js/index.-47GFWev.js:51:42398 Kk@https://deploy-preview-2239.demo.actualbudget.org/static/js/index.-47GFWev.js:51:36612 Ta@https://deploy-preview-2239.demo.actualbudget.org/static/js/index.-47GFWev.js:49:3279 gB@https://deploy-preview-2239.demo.actualbudget.org/static/js/index.-47GFWev.js:51:41273 La@https://deploy-preview-2239.demo.actualbudget.org/static/js/index.-47GFWev.js:51:40265 SD@https://deploy-preview-2239.demo.actualbudget.org/static/js/index.-47GFWev.js:51:35722 I@https://deploy-preview-2239.demo.actualbudget.org/static/js/index.-47GFWev.js:36:1545 R@https://deploy-preview-2239.demo.actualbudget.org/static/js/index.-47GFWev.js:36:1903 EventHandlerNonNull*@https://deploy-preview-2239.demo.actualbudget.org/static/js/index.-47GFWev.js:36:2069 @https://deploy-preview-2239.demo.actualbudget.org/static/js/index.-47GFWev.js:36:3805

image

@joel-jeremy
Copy link
Contributor Author

Thank you @Teprifer for catching that! The screenshots were also very helpful. I have pushed a commit which hopefully fixes the issue :)

@youngcw
Copy link
Member

youngcw commented Jan 19, 2024

something is weird with the sidebar account sorting. If I try to move an account by one place it usually doesn't move to the right location. Moving up seems to work better than moving down. Moving categories seems to work perfect

@joel-jeremy
Copy link
Contributor Author

@youngcw Accounts sorting should be working fine now :)

@youngcw
Copy link
Member

youngcw commented Jan 19, 2024

@joel-jeremy Im still seeing the same issue.
To recreate

  1. make a test file
  2. try to move the "Ally Savings" account down 1. Nothing happens
  3. Try to move it somewhere else, it moves to the bottom
  4. It can now be moved anywhere higher than the current position
  5. try to move down again, it goes to the bottom

@joel-jeremy
Copy link
Contributor Author

The same problem seem to exist in the latest release version of Actual Budget and only happens with a fresh test budget. We might need to look at how the test file inserts the sort order of the accounts, but we should probably fix that in a separate PR.

@youngcw
Copy link
Member

youngcw commented Jan 19, 2024

The same problem seem to exist in the latest release version of Actual Budget and only happens with a fresh test budget. We might need to look at how the test file inserts the sort order of the accounts, but we should probably fix that in a separate PR.

I do see it if I import one of my budget files, but it is less broken. I can move the accounts around a bit before they decide to jump to the bottom. Since this issue is existing, I think its fine to ignore in this PR.

@rich-howell
Copy link
Contributor

@joel-jeremy Im still seeing the same issue. To recreate

  1. make a test file
  2. try to move the "Ally Savings" account down 1. Nothing happens
  3. Try to move it somewhere else, it moves to the bottom
  4. It can now be moved anywhere higher than the current position
  5. try to move down again, it goes to the bottom

I can replicate this on the demo file in the deploy PR

  • Move Ally Savings down
  • Nothing Happens
  • Move Ally Savings down
  • It goes to the bottom
  • Move it back to the top
  • It goes to the top
  • Move it down one row
  • it now moves down one row

@joel-jeremy
Copy link
Contributor Author

joel-jeremy commented Jan 20, 2024

Upon further investigation, it looks like importing / creating test budget incorrectly sets the sort_order of all the imported accounts to the same value. This messes up the sorting logic that we currently have which calculates for the middle sort_order values between two accounts. This exists in the latest release version / edge. We should create a separate issue to track the fix for that.

@Teprifer
Copy link

Seeing the same weird behaviour with Ally Savings in the demo budget as per above steps.

Minor/irrelevant notes:
When dropping a dragged category or account it does a weird hoppy animation. Groups don't do this if they're collapsed first - you can't tell if this occurs when they start as expanded since there's an animation as they return to being expanded.

Is it meant to have "Group:" prepended when dragging a group around? (if not, wouldn't bother fixing)
image

Groups staying collapsed if they start collapsed when dragging begins, and staying expanded if expanded originally is good.

I can't think why you'd even look at fixing this, but for fun:

  1. Grab a group, they all collapse (presumably to make it easier to move around 👍)
  2. Alt-tab or otherwise lose focus from the browser window.
  3. Click on another tab.
  4. The group is placed where it last went due to mouse movements, but the groups stay collapsed.

@joel-jeremy
Copy link
Contributor Author

@Teprifer I have added a bit of delay before expanding back the category groups. Animation should be smoother now.

I also have updated the accounts in the mobile accounts page to be sortable.

@joel-jeremy
Copy link
Contributor Author

Created #2264 for the account sorting bug.

@Teprifer
Copy link

@Teprifer I have added a bit of delay before expanding back the category groups. Animation should be smoother now.

I also have updated the accounts in the mobile accounts page to be sortable.

It wasn't what I meant, but that added delay feels really good, creates a nice continuity feeling from drop -> see placement -> UI restores to expanded view, so keep it. :)

I was referring to when you let go of a category or account, the one you're holding jumps up and down a bit, before it settles in to place. This weird hopping animation doesn't happen with groups.
Mobile moving accounts has the same hopping animation.

Seems to be it tries to go where it originally was, then immediately goes to where you'd placed it.

Minor visual issue on mobile accounts, the account that is moved retains the selected/mouse-over highlight after being moved.
Oddly sometimes it doesn't happen, and sometimes I've been able to drag and drop, that one retains the highlight, then I could drag and drop another one, while the highlight remained on the first.

This only occurred on an actual mobile device using a finger to tap & hold, when resizing on desktop to the mobile size this doesn't happen because the mouse cursor is over the one that was moved.

Copy link
Contributor

This PR is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.

@github-actions github-actions bot added the Stale label Feb 24, 2024
Copy link
Contributor

This PR was closed because it has been stalled for 5 days with no activity.

@github-actions github-actions bot closed this Feb 29, 2024
@twk3 twk3 reopened this Feb 29, 2024
@twk3 twk3 removed the Stale label Feb 29, 2024
Copy link
Contributor

This PR is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.

@github-actions github-actions bot added the Stale label Mar 31, 2024
Copy link
Contributor

github-actions bot commented Apr 6, 2024

This PR was closed because it has been stalled for 5 days with no activity.

@github-actions github-actions bot closed this Apr 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants